package com.beyond.trace.requestVo;

import com.beyond.trace.domain.YieldConfigure;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @ClassName: YieldConfigureReq
 * @author: z越
 * @date: 2024/4/8  10:40
 * @description
 */
@Data
@ApiModel
public class YieldConfigureReq {
    @ApiModelProperty("年份")
    @NotBlank(message = "年份不能为空")
    private String year;
    @ApiModelProperty("面积")
    private String area;
    @ApiModelProperty("产值")
    private String yield;
    @ApiModelProperty("产量")
    private String outputValue;

    public YieldConfigure toPo(){
        YieldConfigure po = new YieldConfigure();
        po.setArea(this.area);
        po.setYear(this.year);
        po.setOutputValue(this.outputValue);
        po.setYield(yield);
        return po;
    }

    public YieldConfigure toOld(YieldConfigure oldPo){
        oldPo.setArea(this.area);
        oldPo.setYear(this.year);
        oldPo.setOutputValue(this.outputValue);
        oldPo.setYield(yield);
        return oldPo;
    }
}
